package dian.qing.li.demo.security.constants;

import org.springframework.lang.Nullable;

import java.util.HashMap;
import java.util.Map;

public enum CodeKey {
    /**
     * 角色
     */
    ROLE,
    AUTHORITY,
    ;

    private CodeKey() {
    }

    public static CodeKey resolve(@Nullable String code) {
        return code != null ? codeKey.get(code) : null;
    }

    private static final Map<String, CodeKey> codeKey = new HashMap(16);

    static {
        CodeKey[] var0 = values();
        int var1 = var0.length;
        for (int var2 = 0; var2 < var1; ++var2) {
            CodeKey key = var0[var2];
            codeKey.put(key.name(), key);
        }
    }

    @Override
    public String toString() {
        return this.name();
    }
}
